#include "PointStruct.h"

// PointStructConsumer 模块
void PointStructConsumer::consume() {
  int i = 0;
  wait(50, sc_core::SC_NS);
  std::cout << "PointStructConsumer consume work" << std::endl;
  while(1){
    PointStruct point;
    if(in->num_available() > 0){
      in->read(point);
      point_entry[i] = &point;
      point_entry[i]->print();
      std::cout << "PointStructConsumer: Received PointStruct " << i++ << std::endl;
    } else{ 
      wait(10, sc_core::SC_NS);
      if(in->num_available() == 0){
        break;
      }
    }
  }
}
